/**
 * Created by user on 2018/4/16.
 */
const PREFIX = 'menu_'

const MenuType = {
  toggle_collapsed: PREFIX + 'toggle_collapsed',
  change_open_key: PREFIX + 'change_open_key',
  change_select_key: PREFIX + 'change_select_key',
}

const toggleCollapsed = (bool) => {
  return {
    type: MenuType.toggle_collapsed,
    collapsed: bool
  }
}

const changeOpenKey = (key) => {
  return {
    type: MenuType.change_open_key,
    key: key
  }
}

const changeSelectKey = (key) => {
  return {
    type: MenuType.change_select_key,
    key: key
  }
}


module.exports = {
  MenuType,
  toggleCollapsed,
  changeOpenKey,
  changeSelectKey
}
